﻿namespace HRM.CORE.REPORT
{
    using APP.HELPER.Utils.Language;
    using DevExpress.Utils;
    using DevExpress.XtraPrinting;
    using DevExpress.XtraReports.UI;
    using Dictionary.ERP;
    using HRM.CORE;
    using HRM.CORE.CLASS;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Drawing.Printing;

    public class rptListSalaryEmployee : XtraReport
    {
        private BottomMarginBand BottomMargin;
        private XRTableCell chSex;
        private XRTableCell colBasicSalary;
        private XRTableCell colBeginDate;
        private XRTableCell colBirthday;
        private XRTableCell colBirthPlace;
        private XRTableCell colCoefficient;
        private XRTableCell colDescription;
        private XRTableCell colEmployeeCode;
        private XRTableCell colFirstName;
        private XRTableCell colLastName;
        private XRTableCell colOrder;
        private XRTableCell colSex;
        private XRTableCell colStep;
        private IContainer components;
        private DetailBand Detail;
        private XRTableCell dtBeginDate;
        private XRTableCell dtBirthday;
        private XRTableCell dtBirthPlace;
        private GroupHeaderBand GroupHeader1;
        private HRM_EMPLOYEE l_Employee;
        private string m_Code;
        private int m_Level;
        private int m_Order;
        private XRPictureBox ptPhoto;
        private ReportFooterBand ReportFooter;
        private ReportHeaderBand ReportHeader;
        private TopMarginBand TopMargin;
        private XRLabel txtAddress;
        private XRTableCell txtBasicSalary;
        private XRTableCell txtCoefficientSalary;
        private XRLabel txtCompany;
        private XRTableCell txtDescription;
        private XRTableCell txtEmployeeCode;
        private XRTableCell txtFirstName;
        private XRTableCell txtLastName;
        private XRTableCell txtOrder;
        private XRTableCell txtStepSalary;
        private XRLabel txtTitle;
        private XRLabel txtUnit;
        private XRLabel xrLabel2;
        private XRTable xrTable1;
        private XRTable xrTable2;
        private XRTableRow xrTableRow1;
        private XRTableRow xrTableRow2;

        public rptListSalaryEmployee()
        {
            this.l_Employee = new HRM_EMPLOYEE();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_Order = 0;
            this.components = null;
            this.InitializeComponent();
            this.InitMultiLanguages();
        }

        public rptListSalaryEmployee(int Level, string Code)
        {
            this.l_Employee = new HRM_EMPLOYEE();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_Order = 0;
            this.components = null;
            this.InitializeComponent();
            this.InitMultiLanguages();
            this.m_Level = Level;
            this.m_Code = Code;
        }

        private void chSex_BeforePrint(object sender, PrintEventArgs e)
        {
            try
            {
                if (Convert.ToBoolean(this.chSex.Text))
                {
                    this.chSex.Text = "Nam";
                }
                else
                {
                    this.chSex.Text = "Nữ";
                }
            }
            catch
            {
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void dtBeginDate_BeforePrint(object sender, PrintEventArgs e)
        {
            try
            {
                this.dtBeginDate.Text = Convert.ToDateTime(this.dtBeginDate.Text).ToShortDateString();
            }
            catch
            {
            }
        }

        private void dtBirthday_BeforePrint(object sender, PrintEventArgs e)
        {
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.Get(this.txtEmployeeCode.Text);
            this.dtBirthday.Text = hrm_employee.BirthdayDay.ToString() + "/" + hrm_employee.BirthdayMonth.ToString() + "/" + hrm_employee.BirthdayYear.ToString();
        }

        private void InitializeComponent()
        {
            this.Detail = new DetailBand();
            this.xrTable2 = new XRTable();
            this.xrTableRow2 = new XRTableRow();
            this.txtOrder = new XRTableCell();
            this.txtEmployeeCode = new XRTableCell();
            this.txtFirstName = new XRTableCell();
            this.txtLastName = new XRTableCell();
            this.dtBirthday = new XRTableCell();
            this.chSex = new XRTableCell();
            this.dtBirthPlace = new XRTableCell();
            this.dtBeginDate = new XRTableCell();
            this.txtStepSalary = new XRTableCell();
            this.txtCoefficientSalary = new XRTableCell();
            this.txtBasicSalary = new XRTableCell();
            this.txtDescription = new XRTableCell();
            this.TopMargin = new TopMarginBand();
            this.BottomMargin = new BottomMarginBand();
            this.ReportHeader = new ReportHeaderBand();
            this.ptPhoto = new XRPictureBox();
            this.txtTitle = new XRLabel();
            this.txtUnit = new XRLabel();
            this.txtAddress = new XRLabel();
            this.txtCompany = new XRLabel();
            this.xrLabel2 = new XRLabel();
            this.GroupHeader1 = new GroupHeaderBand();
            this.xrTable1 = new XRTable();
            this.xrTableRow1 = new XRTableRow();
            this.colOrder = new XRTableCell();
            this.colEmployeeCode = new XRTableCell();
            this.colFirstName = new XRTableCell();
            this.colLastName = new XRTableCell();
            this.colBirthday = new XRTableCell();
            this.colSex = new XRTableCell();
            this.colBirthPlace = new XRTableCell();
            this.colBeginDate = new XRTableCell();
            this.colStep = new XRTableCell();
            this.colCoefficient = new XRTableCell();
            this.colBasicSalary = new XRTableCell();
            this.colDescription = new XRTableCell();
            this.ReportFooter = new ReportFooterBand();
            this.xrTable2.BeginInit();
            this.xrTable1.BeginInit();
            this.BeginInit();
            this.Detail.Controls.AddRange(new XRControl[] { this.xrTable2 });
            this.Detail.HeightF = 29.16667f;
            this.Detail.Name = "Detail";
            this.Detail.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.Detail.TextAlignment = TextAlignment.TopLeft;
            this.xrTable2.Borders = BorderSide.Bottom | BorderSide.Right | BorderSide.Left;
            this.xrTable2.Font = new Font("Times New Roman", 9.75f);
            this.xrTable2.LocationFloat = new PointFloat(4.768372E-05f, 0f);
            this.xrTable2.Name = "xrTable2";
            this.xrTable2.Rows.AddRange(new XRTableRow[] { this.xrTableRow2 });
            this.xrTable2.SizeF = new SizeF(1039f, 29.16667f);
            this.xrTable2.StylePriority.UseBorders = false;
            this.xrTable2.StylePriority.UseFont = false;
            this.xrTableRow2.Cells.AddRange(new XRTableCell[] { this.txtOrder, this.txtEmployeeCode, this.txtFirstName, this.txtLastName, this.dtBirthday, this.chSex, this.dtBirthPlace, this.dtBeginDate, this.txtStepSalary, this.txtCoefficientSalary, this.txtBasicSalary, this.txtDescription });
            this.xrTableRow2.Name = "xrTableRow2";
            this.xrTableRow2.Weight = 1.0;
            this.txtOrder.Name = "txtOrder";
            this.txtOrder.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtOrder.StylePriority.UsePadding = false;
            this.txtOrder.StylePriority.UseTextAlignment = false;
            this.txtOrder.Text = "txtOrder";
            this.txtOrder.TextAlignment = TextAlignment.MiddleLeft;
            this.txtOrder.Weight = 0.18749981602642024;
            this.txtOrder.BeforePrint += new PrintEventHandler(this.txtOrder_BeforePrint);
            this.txtEmployeeCode.Name = "txtEmployeeCode";
            this.txtEmployeeCode.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtEmployeeCode.StylePriority.UsePadding = false;
            this.txtEmployeeCode.StylePriority.UseTextAlignment = false;
            this.txtEmployeeCode.Text = "txtEmployeeCode";
            this.txtEmployeeCode.TextAlignment = TextAlignment.MiddleLeft;
            this.txtEmployeeCode.Weight = 0.41600003289998788;
            this.txtFirstName.Name = "txtFirstName";
            this.txtFirstName.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtFirstName.StylePriority.UsePadding = false;
            this.txtFirstName.StylePriority.UseTextAlignment = false;
            this.txtFirstName.Text = "txtFirstName";
            this.txtFirstName.TextAlignment = TextAlignment.MiddleLeft;
            this.txtFirstName.Weight = 0.72983302692065766;
            this.txtLastName.Name = "txtLastName";
            this.txtLastName.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtLastName.StylePriority.UsePadding = false;
            this.txtLastName.StylePriority.UseTextAlignment = false;
            this.txtLastName.Text = "txtLastName";
            this.txtLastName.TextAlignment = TextAlignment.MiddleLeft;
            this.txtLastName.Weight = 0.34133335567568956;
            this.dtBirthday.Name = "dtBirthday";
            this.dtBirthday.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.dtBirthday.StylePriority.UsePadding = false;
            this.dtBirthday.StylePriority.UseTextAlignment = false;
            this.dtBirthday.Text = "dtBirthday";
            this.dtBirthday.TextAlignment = TextAlignment.MiddleLeft;
            this.dtBirthday.Weight = 0.41205570071556552;
            this.dtBirthday.BeforePrint += new PrintEventHandler(this.dtBirthday_BeforePrint);
            this.chSex.Name = "chSex";
            this.chSex.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.chSex.StylePriority.UsePadding = false;
            this.chSex.StylePriority.UseTextAlignment = false;
            this.chSex.Text = "chSex";
            this.chSex.TextAlignment = TextAlignment.MiddleCenter;
            this.chSex.Weight = 0.24529184694834272;
            this.chSex.BeforePrint += new PrintEventHandler(this.chSex_BeforePrint);
            this.dtBirthPlace.Name = "dtBirthPlace";
            this.dtBirthPlace.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.dtBirthPlace.StylePriority.UsePadding = false;
            this.dtBirthPlace.StylePriority.UseTextAlignment = false;
            this.dtBirthPlace.Text = "dtBirthPlace";
            this.dtBirthPlace.TextAlignment = TextAlignment.MiddleLeft;
            this.dtBirthPlace.Weight = 0.87354161936865293;
            this.dtBirthPlace.BeforePrint += new PrintEventHandler(this.dtBirthday_BeforePrint);
            this.dtBeginDate.Name = "dtBeginDate";
            this.dtBeginDate.StylePriority.UseTextAlignment = false;
            this.dtBeginDate.Text = "dtBeginDate";
            this.dtBeginDate.TextAlignment = TextAlignment.MiddleCenter;
            this.dtBeginDate.Weight = 0.48866702675803375;
            this.dtBeginDate.BeforePrint += new PrintEventHandler(this.dtBeginDate_BeforePrint);
            this.txtStepSalary.Name = "txtStepSalary";
            this.txtStepSalary.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtStepSalary.StylePriority.UsePadding = false;
            this.txtStepSalary.StylePriority.UseTextAlignment = false;
            this.txtStepSalary.Text = "txtStepSalary";
            this.txtStepSalary.TextAlignment = TextAlignment.MiddleCenter;
            this.txtStepSalary.Weight = 0.2388893428142273;
            this.txtCoefficientSalary.Name = "txtCoefficientSalary";
            this.txtCoefficientSalary.StylePriority.UseTextAlignment = false;
            this.txtCoefficientSalary.Text = "txtCoefficientSalary";
            this.txtCoefficientSalary.TextAlignment = TextAlignment.MiddleCenter;
            this.txtCoefficientSalary.Weight = 0.3426868749533899;
            this.txtBasicSalary.Name = "txtBasicSalary";
            this.txtBasicSalary.Padding = new PaddingInfo(0, 4, 0, 0, 100f);
            this.txtBasicSalary.StylePriority.UsePadding = false;
            this.txtBasicSalary.StylePriority.UseTextAlignment = false;
            this.txtBasicSalary.Text = "txtBasicSalary";
            this.txtBasicSalary.TextAlignment = TextAlignment.MiddleRight;
            this.txtBasicSalary.Weight = 0.60875752860431265;
            this.txtDescription.Name = "txtDescription";
            this.txtDescription.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtDescription.StylePriority.UsePadding = false;
            this.txtDescription.StylePriority.UseTextAlignment = false;
            this.txtDescription.TextAlignment = TextAlignment.MiddleLeft;
            this.txtDescription.Weight = 0.65677748716888618;
            this.TopMargin.HeightF = 70f;
            this.TopMargin.Name = "TopMargin";
            this.TopMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.TopMargin.TextAlignment = TextAlignment.TopLeft;
            this.BottomMargin.HeightF = 56f;
            this.BottomMargin.Name = "BottomMargin";
            this.BottomMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.BottomMargin.TextAlignment = TextAlignment.TopLeft;
            this.ReportHeader.Controls.AddRange(new XRControl[] { this.ptPhoto, this.txtTitle, this.txtUnit, this.txtAddress, this.txtCompany, this.xrLabel2 });
            this.ReportHeader.HeightF = 123f;
            this.ReportHeader.Name = "ReportHeader";
            this.ptPhoto.LocationFloat = new PointFloat(6.000048f, 4f);
            this.ptPhoto.Name = "ptPhoto";
            this.ptPhoto.SizeF = new SizeF(88.54166f, 58.33333f);
            this.ptPhoto.Sizing = ImageSizeMode.ZoomImage;
            this.txtTitle.Font = new Font("Times New Roman", 16f, FontStyle.Bold);
            this.txtTitle.LocationFloat = new PointFloat(3.178914E-05f, 68.75f);
            this.txtTitle.Name = "txtTitle";
            this.txtTitle.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtTitle.SizeF = new SizeF(1039f, 30.25001f);
            this.txtTitle.StylePriority.UseFont = false;
            this.txtTitle.StylePriority.UseTextAlignment = false;
            this.txtTitle.Text = "DANH S\x00c1CH LƯƠNG CNVC-LĐ TH\x00c1NG 00/0000";
            this.txtTitle.TextAlignment = TextAlignment.MiddleCenter;
            this.txtUnit.Font = new Font("Times New Roman", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.txtUnit.LocationFloat = new PointFloat(580.6667f, 10.00001f);
            this.txtUnit.Name = "txtUnit";
            this.txtUnit.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtUnit.SizeF = new SizeF(458.3333f, 17.70833f);
            this.txtUnit.StylePriority.UseFont = false;
            this.txtUnit.StylePriority.UseTextAlignment = false;
            this.txtUnit.TextAlignment = TextAlignment.MiddleRight;
            this.txtAddress.Font = new Font("Times New Roman", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.txtAddress.LocationFloat = new PointFloat(161.5417f, 31.70837f);
            this.txtAddress.Name = "txtAddress";
            this.txtAddress.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtAddress.SizeF = new SizeF(632.2081f, 17.70833f);
            this.txtAddress.StylePriority.UseFont = false;
            this.txtAddress.Text = "txtAddress";
            this.txtCompany.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.txtCompany.LocationFloat = new PointFloat(105.5417f, 10.00001f);
            this.txtCompany.Name = "txtCompany";
            this.txtCompany.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtCompany.SizeF = new SizeF(462.1666f, 17.70833f);
            this.txtCompany.StylePriority.UseFont = false;
            this.txtCompany.Text = "txtCompany";
            this.xrLabel2.Font = new Font("Times New Roman", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.xrLabel2.LocationFloat = new PointFloat(105.5417f, 31.70827f);
            this.xrLabel2.Name = "xrLabel2";
            this.xrLabel2.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel2.SizeF = new SizeF(56f, 17.70834f);
            this.xrLabel2.StylePriority.UseFont = false;
            this.xrLabel2.Text = "Địa Chỉ:";
            this.GroupHeader1.Controls.AddRange(new XRControl[] { this.xrTable1 });
            this.GroupHeader1.HeightF = 40.625f;
            this.GroupHeader1.Name = "GroupHeader1";
            this.xrTable1.AnchorVertical = VerticalAnchorStyles.Bottom;
            this.xrTable1.BackColor = Color.WhiteSmoke;
            this.xrTable1.Borders = BorderSide.All;
            this.xrTable1.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.xrTable1.LocationFloat = new PointFloat(4.768372E-05f, 0f);
            this.xrTable1.Name = "xrTable1";
            this.xrTable1.Rows.AddRange(new XRTableRow[] { this.xrTableRow1 });
            this.xrTable1.SizeF = new SizeF(1039f, 40.625f);
            this.xrTable1.StylePriority.UseBackColor = false;
            this.xrTable1.StylePriority.UseBorders = false;
            this.xrTable1.StylePriority.UseFont = false;
            this.xrTable1.StylePriority.UseTextAlignment = false;
            this.xrTable1.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableRow1.Cells.AddRange(new XRTableCell[] { this.colOrder, this.colEmployeeCode, this.colFirstName, this.colLastName, this.colBirthday, this.colSex, this.colBirthPlace, this.colBeginDate, this.colStep, this.colCoefficient, this.colBasicSalary, this.colDescription });
            this.xrTableRow1.Name = "xrTableRow1";
            this.xrTableRow1.Weight = 1.0;
            this.colOrder.CanGrow = false;
            this.colOrder.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colOrder.Name = "colOrder";
            this.colOrder.StylePriority.UseFont = false;
            this.colOrder.StylePriority.UseTextAlignment = false;
            this.colOrder.Text = "STT";
            this.colOrder.TextAlignment = TextAlignment.MiddleCenter;
            this.colOrder.Weight = 0.18749992582046493;
            this.colEmployeeCode.CanGrow = false;
            this.colEmployeeCode.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colEmployeeCode.Name = "colEmployeeCode";
            this.colEmployeeCode.StylePriority.UseFont = false;
            this.colEmployeeCode.StylePriority.UseTextAlignment = false;
            this.colEmployeeCode.Text = "M\x00e3 nh\x00e2n vi\x00ean";
            this.colEmployeeCode.TextAlignment = TextAlignment.MiddleCenter;
            this.colEmployeeCode.Weight = 0.41600000264430742;
            this.colFirstName.CanGrow = false;
            this.colFirstName.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colFirstName.Name = "colFirstName";
            this.colFirstName.StylePriority.UseFont = false;
            this.colFirstName.StylePriority.UseTextAlignment = false;
            this.colFirstName.Text = "Họ l\x00f3t";
            this.colFirstName.TextAlignment = TextAlignment.MiddleCenter;
            this.colFirstName.Weight = 0.72983301513835774;
            this.colLastName.CanGrow = false;
            this.colLastName.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colLastName.Name = "colLastName";
            this.colLastName.StylePriority.UseFont = false;
            this.colLastName.StylePriority.UseTextAlignment = false;
            this.colLastName.Text = "T\x00ean";
            this.colLastName.TextAlignment = TextAlignment.MiddleCenter;
            this.colLastName.Weight = 0.34133332612230943;
            this.colBirthday.CanGrow = false;
            this.colBirthday.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colBirthday.Name = "colBirthday";
            this.colBirthday.StylePriority.UseFont = false;
            this.colBirthday.StylePriority.UseTextAlignment = false;
            this.colBirthday.Text = "Ng\x00e0y sinh";
            this.colBirthday.TextAlignment = TextAlignment.MiddleCenter;
            this.colBirthday.Weight = 0.41205572130161877;
            this.colSex.CanGrow = false;
            this.colSex.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colSex.Name = "colSex";
            this.colSex.StylePriority.UseFont = false;
            this.colSex.StylePriority.UseTextAlignment = false;
            this.colSex.Text = "Giới t\x00ednh";
            this.colSex.TextAlignment = TextAlignment.MiddleCenter;
            this.colSex.Weight = 0.24529166796685578;
            this.colBirthPlace.CanGrow = false;
            this.colBirthPlace.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colBirthPlace.Name = "colBirthPlace";
            this.colBirthPlace.StylePriority.UseFont = false;
            this.colBirthPlace.StylePriority.UseTextAlignment = false;
            this.colBirthPlace.Text = "Nơi sinh";
            this.colBirthPlace.TextAlignment = TextAlignment.MiddleCenter;
            this.colBirthPlace.Weight = 0.8735412281932613;
            this.colBeginDate.CanGrow = false;
            this.colBeginDate.Name = "colBeginDate";
            this.colBeginDate.Text = "Ng\x00e0y v\x00e0o l\x00e0m";
            this.colBeginDate.Weight = 0.48866763658066725;
            this.colStep.CanGrow = false;
            this.colStep.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colStep.Name = "colStep";
            this.colStep.StylePriority.UseFont = false;
            this.colStep.StylePriority.UseTextAlignment = false;
            this.colStep.Text = "Bậc lương";
            this.colStep.TextAlignment = TextAlignment.MiddleCenter;
            this.colStep.Weight = 0.23888899572800132;
            this.colCoefficient.CanGrow = false;
            this.colCoefficient.Name = "colCoefficient";
            this.colCoefficient.Text = "Hệ số lương";
            this.colCoefficient.Weight = 0.34268684522073856;
            this.colBasicSalary.CanGrow = false;
            this.colBasicSalary.Name = "colBasicSalary";
            this.colBasicSalary.Text = "Lương căn bản";
            this.colBasicSalary.Weight = 0.60875747793603674;
            this.colDescription.CanGrow = false;
            this.colDescription.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colDescription.Name = "colDescription";
            this.colDescription.StylePriority.UseFont = false;
            this.colDescription.StylePriority.UseTextAlignment = false;
            this.colDescription.Text = "Ghi ch\x00fa";
            this.colDescription.TextAlignment = TextAlignment.MiddleCenter;
            this.colDescription.Weight = 0.65677738018472454;
            this.ReportFooter.HeightF = 9f;
            this.ReportFooter.Name = "ReportFooter";
            base.Bands.AddRange(new Band[] { this.Detail, this.TopMargin, this.BottomMargin, this.ReportHeader, this.GroupHeader1, this.ReportFooter });
            base.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            base.Landscape = true;
            base.Margins = new Margins(0x47, 0x3b, 70, 0x38);
            base.PageHeight = 0x33b;
            base.PageWidth = 0x491;
            base.PaperKind = PaperKind.A4;
            base.Version = "9.3";
            this.BeforePrint += new PrintEventHandler(this.rptListSalaryEmployee_BeforePrint);
            this.xrTable2.EndInit();
            this.xrTable1.EndInit();
            this.EndInit();
        }

        private void InitMultiLanguages()
        {
            this.colOrder.Text = MultiLanguages.GetString("tbl_HRM_EMPLOYEE", "No", this.colOrder.Text);
            this.colEmployeeCode.Text = MultiLanguages.GetString("tbl_HRM_EMPLOYEE", "EmployeeCode", this.colEmployeeCode.Text);
            this.colFirstName.Text = MultiLanguages.GetString("tbl_HRM_EMPLOYEE", "FirstName", this.colFirstName.Text);
            this.colLastName.Text = MultiLanguages.GetString("tbl_HRM_EMPLOYEE", "LastName", this.colLastName.Text);
            this.colSex.Text = MultiLanguages.GetString("tbl_HRM_EMPLOYEE", "Sex", this.colSex.Text);
            this.colBirthday.Text = MultiLanguages.GetString("tbl_HRM_EMPLOYEE", "Birthday", this.colBirthday.Text);
            this.colBirthPlace.Text = MultiLanguages.GetString("tbl_HRM_EMPLOYEE", "Birthplace", this.colBirthPlace.Text);
            this.colBeginDate.Text = MultiLanguages.GetString("tbl_HRM_EMPLOYEE", "BeginDate", this.colBeginDate.Text);
            this.colStep.Text = MultiLanguages.GetString("tbl_HRM_EMPLOYEE", "StepSalary", this.colStep.Text);
            this.colCoefficient.Text = MultiLanguages.GetString("tbl_HRM_EMPLOYEE", "CoefficientSalary", this.colCoefficient.Text);
            this.colBasicSalary.Text = MultiLanguages.GetString("tbl_HRM_EMPLOYEE", "BasicSalary", this.colBasicSalary.Text);
            this.colDescription.Text = MultiLanguages.GetString("tbl_HRM_EMPLOYEE", "Description", this.colDescription.Text);
        }

        private void LoadAllData()
        {
            DataSet set = new DataSet();
            DataTable table = new DataTable();
            table = this.l_Employee.GetListCurrentNow(this.m_Level, this.m_Code, -1);
            if (this.m_Level != 0)
            {
                if (this.m_Level == 1)
                {
                    HRM_BRANCH hrm_branch = new HRM_BRANCH();
                    hrm_branch.Get(this.m_Code);
                    this.txtUnit.Text = "Đơn vị: " + hrm_branch.BranchName;
                }
                else if (this.m_Level == 2)
                {
                    HRM_DEPARTMENT hrm_department = new HRM_DEPARTMENT();
                    hrm_department.Get(this.m_Code);
                    this.txtUnit.Text = "Đơn vị: " + hrm_department.DepartmentName;
                }
                else if (this.m_Level == 3)
                {
                    HRM_GROUP hrm_group = new HRM_GROUP();
                    hrm_group.Get(this.m_Code);
                    this.txtUnit.Text = "Đơn vị: " + hrm_group.GroupName;
                }
            }
            set.Tables.Add(table);
            base.DataSource = set;
            this.txtEmployeeCode.DataBindings.Add("Text", base.DataSource, "EmployeeCode");
            this.txtFirstName.DataBindings.Add("Text", base.DataSource, "FirstName");
            this.txtLastName.DataBindings.Add("Text", base.DataSource, "LastName");
            this.chSex.DataBindings.Add("Text", base.DataSource, "Sex");
            this.dtBirthPlace.DataBindings.Add("Text", base.DataSource, "BirthPlace");
            this.dtBeginDate.DataBindings.Add("Text", base.DataSource, "BeginDate");
            this.txtStepSalary.DataBindings.Add("Text", base.DataSource, "StepSalary");
            this.txtCoefficientSalary.DataBindings.Add("Text", base.DataSource, "CoefficientSalary");
            this.txtBasicSalary.DataBindings.Add("Text", base.DataSource, "BasicSalary", "{0:##,##0}");
        }

        private void rptListSalaryEmployee_BeforePrint(object sender, PrintEventArgs e)
        {
            this.txtTitle.Text = "DANH S\x00c1CH LƯƠNG CNVC-LĐ TH\x00c1NG " + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Year.ToString();
            this.LoadAllData();
            //if (MyInfo.Get(MyEncryption.Encrypt("ERP01", "123654", true)) == "OK")
            {
                this.txtCompany.Text = "";//MyInfo.Company.ToUpper();
                this.txtAddress.Text = "";//MyInfo.Address;
                this.ptPhoto.Image = null;//MyInfo.Photo;
            }
            CreateFooterReport.CreateFooter("IsOther", this.ReportFooter, this);
        }

        private void txtOrder_BeforePrint(object sender, PrintEventArgs e)
        {
            this.m_Order++;
            this.txtOrder.Text = this.m_Order.ToString();
        }
    }
}

